package com.joker.aigc.chat.service;

import com.joker.aigc.chat.domain.dto.GroupMemberAddDto;
import com.joker.aigc.chat.domain.dto.GroupMemberAdminAddDto;
import com.joker.aigc.chat.domain.dto.GroupMemberAdminRevokeDto;
import com.joker.aigc.chat.domain.dto.GroupMemberDelDto;
import com.joker.aigc.chat.domain.dto.GroupMemberExitDto;
import com.joker.aigc.chat.domain.dto.GroupMemberInvitationDto;
import com.joker.aigc.chat.domain.entity.Room;
import com.baomidou.mybatisplus.extension.service.IService;
import com.joker.aigc.chat.domain.entity.RoomFriend;
import com.joker.aigc.chat.domain.entity.RoomGroup;
import com.joker.aigc.chat.domain.vo.GroupMemberListVo;
import com.joker.aigc.chat.domain.vo.GroupMemberVo;
import com.joker.aigc.chat.domain.vo.RoomGroupVo;

import java.util.List;

/**
 * @author 20346
 * @description 针对表【room(房间表)】的数据库操作Service
 * @createDate 2023-12-17 11:26:08
 */
public interface RoomService extends IService<Room> {

    /**
     * 获取用户的列表信息
     *
     * @param uid    用户id
     * @param roomId 房间id
     * @return 返回房间的具体信息
     */
    RoomGroupVo groupDetail(Long uid, Long roomId);

    // 热门房间
    List<Room> getHotRoom();


    List<RoomGroupVo> queryGroupList(Long uid);


    List<GroupMemberVo> getMemberPage(Long roomId);


    List<GroupMemberListVo> getMemberList(Long roomId);

    void delMember(Long uid, GroupMemberDelDto dto);

    /**
     * 退出群聊
     *
     * @param uid 用户id
     * @param dto 退出信息
     */
    void exitGroup(Long uid, GroupMemberExitDto dto);

    Long addGroup(Long uid, GroupMemberAddDto groupMemberAddDto);

    /**
     * 已经存在群聊信息。开始邀请好友
     *
     * @param uid                      邀请人
     * @param groupMemberInvitationDto 邀请人员
     */
    void addMember(Long uid, GroupMemberInvitationDto groupMemberInvitationDto);

    /**
     * 添加管理员
     *
     * @param uid                    用户的id信息
     * @param groupMemberAdminAddDto 需要添加管理员的id
     */
    void addAdmin(Long uid, GroupMemberAdminAddDto groupMemberAdminAddDto);

    void revokeAdmin(Long uid, GroupMemberAdminRevokeDto groupMemberAdminRevokeDto);


    /**
     * 创建一个单聊房间
     */
    RoomFriend createFriendRoom(List<Long> uidList);

    RoomFriend getFriendRoom(Long uid1, Long uid2);

    /**
     * 禁用一个单聊房间
     */
    void disableFriendRoom(List<Long> uidList);

    /**
     * 创建一个群聊房间
     */
    RoomGroup createGroupRoom(Long uid);

//    List<Room> getRoomByIds(List<Long> ids);

}
